﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace RazorSourceGenerator.Converter
{
    public class RowBackgroundConverter : IMultiValueConverter
    {
        private static System.Windows.Media.Brush rowOverBrush;

        static RowBackgroundConverter()
        {
            rowOverBrush = (System.Windows.Media.Brush)(new System.Windows.Media.BrushConverter()).ConvertFromString("#66119EDA");
        }

        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var isSelected = System.Convert.ToBoolean(values[0]);
            var isMouseOver = System.Convert.ToBoolean(values[1]);
            if (isMouseOver)
                return rowOverBrush;
            else
                return System.Windows.Media.Brushes.White;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    } 

}
